// 具体请求封装

import { postRequest, getRequest, dpwnloadRequest } from "@/libs/axios.js"

export const getMenu = params => {
    return getRequest(`/menu/userTree/${params}`, params)
}

export const tokenRef = params => {
    return postRequest('/admin/refreshToken', params, 'application/json')
}

export const userLogin = params => {
    return postRequest('/admin/login', params, 'application/json')
}

export const getSysUserList = params => {
    return getRequest('/admin/list', params)
}

export const addSysUser = params => {
    return postRequest('/admin/save', params, 'application/json')
}

export const modifySysUserStatus = (params) => {
    return getRequest(`/admin/status`, params)
}

export const removeSysUser = id => {
    return getRequest(`/admin/delete/${id}`, id)
}

export const getSysUserDetails = id => {
    return getRequest(`/admin/findDetails/${id}`, id)
}

export const getSysUserRoles = id => {
    return getRequest(`/admin/findRole/${id}`, id)
}

export const updateSysUserRole = (id, params) => {
    return postRequest(`/admin/roleUpdate/${id}`, params, 'application/json')
}

export const getAllRole = () => {
    return getRequest('/role/findAll')
}

export const getSysRoleList = params => {
    return getRequest('/role/list', params)
}

export const addSysRole = params => {
    return postRequest('/role/save', params, 'application/json')
}

export const removeSysRole = (id) => {
    return getRequest(`/role/delete/${id}`, id)
}

export const modifySysRoleStatus = (params) => {
    return getRequest(`/role/status`, params)
}

export const getSysRoleDetails = id => {
    return getRequest(`/role/findDetails/${id}`, id)
}

export const getSysRoleMenu = id => {
    return getRequest(`/menu/userTree/${id}`, id)
}

export const updateRoleMenu = params => {
    return getRequest('/role/menuUpdate', params)
}

export const getMenuTree = () => {
    return getRequest('/menu/tree')
}

export const addMenu = params => {
    return postRequest('/menu/save', params, 'application/json')
}

export const removeMenu = (id) => {
    return postRequest(`/menu/delete`, id, 'application/json')
}

export const getMenuDetails = id => {
    return getRequest(`/menu/details/${id}`, id)
}

export const getStyleAll = (params) => {
    return getRequest('/style/list', params)
}

export const styleAdd = (params) => {
    return postRequest('/style/save', params, 'application/json')
}

export const deleteStyleById = (id) => {
    return getRequest(`/style/delete/${id}`, id)
}

export const getRobesElementAll = (params) => {
    return postRequest('/ele_element/selectElement', params, 'application/json')
}

export const addRobesElementItem = (params) => {
    return postRequest('/ele_element/insertElement', params, 'application/json')
}

export const editRobesElementItem = (params) => {
    return postRequest('/ele_element/updateEleElement', params, 'application/json')
}

export const deleteRobesElementItem = (params) => {
    return postRequest('/ele_element/deleteElement', params, 'application/json')
}

export const getCodeRuleAll = (params) => {
    return postRequest('/matDetail/getMatDetails', params, 'application/json')
}

export const getMatCode = (params) => {
    return postRequest('/mat/getMatEncode', params, 'application/json')
}

export const addParMatCode = (params) => {
    return postRequest('/mat/insertMatEncode', params, 'application/json')
}

export const modifyMatCode = (params) => {
    return postRequest('/mat/updateMatEncode', params, 'application/json')
}

export const deleteMatCode = (params) => {
    return postRequest('/mat/deleteMatEncode', params, 'application/json')
}

export const updateParMatCode = (params) => {
    return postRequest('/mat/getMatBhForAdd', params, 'application/json')
}

export const insertMatDetail = (params) => {
    return postRequest('/matDetail/insertMatDetail', params, 'application/json')
}

export const getRolesMenu = (params) => {
    return postRequest('/role/getMenusByRole', params, 'application/json')
}

export const updateRolesMenu = (params) => {
    return postRequest(`role/distributionMenu`, params, 'application/json')
}

export const removeMatDet = (params) => {
    return postRequest('/matDetail/deleteMatDetail', params, 'application/json')
}

export const modifyMatDet = (params) => {
    return postRequest('/matDetail/updateMatDetail', params, 'application/json')
}

export const getFabricGroupAll = (params) => {
    return getRequest('/group/list', params)
}

export const addorModifyGroup = (params) => {
    return postRequest('/group/save', params, 'application/json')
}

export const delGroupItem = id => {
    return getRequest(`/group/delete/${id}`, id)
}

export const getGroupFindAll = () => {
    return getRequest('/group/findAll')
}

export const getFabricNotInElement = (params) => {
    return postRequest('/fabric/getFabricNotInElement', params, 'application/json')
}

export const getFabricAll = (params) => {
    return getRequest('/fabric/list', params)
}

export const addFabric = (params) => {
    return postRequest('/fabric/save', params, 'application/json')
}

export const ModifyFabric = (params) => {
    return postRequest('/fabric/updateFabricElement', params, 'application/json')
}

export const delFabricById = id => {
    return getRequest(`/fabric/delete/${id}`, id)
}

export const getGroupTree = (params) => {
    return getRequest('/group/tree', params)
}

export const getEmbroideryNotInElement = (params) => {
    return postRequest('/embroidery/getEmbroideryNotInElement', params, 'application/json')
}

export const getEmbroideryList = (params) => {
    return getRequest('/embroidery/list', params)
}

export const addEmbroidery = (params) => {
    return postRequest('/embroidery/save', params, 'application/json')
}

export const updateEmbroidery = (params) => {
    return postRequest('/embroidery/updateFabricElement', params, 'application/json')
}

export const delEmbroidery = id => {
    return getRequest(`/embroidery/delete/${id}`, id)
}

export const getFabricWithEmbroidery = (params) => {
    return postRequest('/embroidery/getFabricWithEmbroidery', params, 'application/json')
}

export const distributionFabric = (params) => {
    return postRequest('/embroidery/distributionFabric', params, 'application/json')
}

export const getMatFakeStkList = (params) => {
    return postRequest('/matStock/getMatFakeStkList', params, 'application/json')
}

export const updateMatFakeStk = (params) => {
    return postRequest('/matStock/updateMatFakeStk', params, 'application/json')
}

export const getStkFakeRecord = (params) => {
    return postRequest('/matStock/getStkFakeRecord', params, 'application/json')
}

export const getRobesSize = (params) => {
    return postRequest('/ele_element/getRobeSizeList', params, 'application/json')
}

export const addRobesSize = (params) => {
    return postRequest('/ele_element/addRobeSize', params, 'application/json')
}

export const updateRobesSize = (params) => {
    return postRequest('/ele_element/updateRobeSize', params, 'application/json')
}

export const deleteRobesSize = (params) => {
    return postRequest('/ele_element/deleteRobeSize', params, 'application/json')
}

export const getKaftenLengthList = (params) => {
    return postRequest('/ele_element/getKaftenLengthList', params, 'application/json')
}

export const addKaftenLength = (params) => {
    return postRequest('/ele_element/addKaftenLength', params, 'application/json')
}

export const updateKaftenLength = (params) => {
    return postRequest('/ele_element/updateKaftenLength', params, 'application/json')
}

export const deleteKaftenLength = (params) => {
    return postRequest('/ele_element/deleteKaftenLength', params, 'application/json')
}

export const getKaftenSizeList = (params) => {
    return postRequest('/ele_element/getKaftenSizeList', params, 'application/json')
}

export const addKaftenSize = (params) => {
    return postRequest('/ele_element/addKaftenSize', params, 'application/json')
}

export const updateKaftenSize = (params) => {
    return postRequest('/ele_element/updateKaftenSize', params, 'application/json')
}

export const deleteKaftenSize = (params) => {
    return postRequest('/ele_element/deleteKaftenSize', params, 'application/json')
}

export const getPmMdlList = (params) => {
    return postRequest('/pm_Mdl/getPmMdlList', params, 'application/json')
}

export const getMaxNumFromChild = (params) => {
    return postRequest('/mat/getMaxNumFromChild', params, 'application/json')
}

export const getRobeItemList = params => {
    return postRequest('/item/list', params, 'application/json')
}

export const addRobeItem = (params) => {
    return postRequest('/item/add', params, 'application/json')
}

export const getStyleFindAll = params => {
    return getRequest('/style/findAall', params)
}

export const publishStatus = params => {
    return postRequest('/item/update/publishStatus', params, 'application/json')
}

export const deleteStatus = params => {
    return postRequest('/item/update/deleteStatus', params, 'application/json')
}

export const hotStatus = params => {
    return postRequest('/item/update/hotStatus', params, 'application/json')
}

export const newStatus = params => {
    return postRequest('/item/update/newStatus', params, 'application/json')
}

export const getClotheMatForProductAdd = params => {
    return postRequest('/product/manage/getClotheMatForProductAdd', params, 'application/json')
}

export const getItemDetails = id => {
    return getRequest(`/item/details/${id}`, id)
}

export const updateItem = params => {
    return postRequest('/item/update', params, 'application/json')
}

export const proManageList = params => {
    return getRequest('/product/manage/list', params)
}

export const addProduct = params => {
    return postRequest('/product/manage/add', params, 'application/json')
}

export const updateProduct = params => {
    return postRequest('/product/manage/update', params, 'application/json')
}

export const getProductDetails = id => {
    return getRequest(`/product/manage/details/${id}`, id)
}

export const deleteProduct = params => {
    return postRequest('/product/manage/update/deleteStatus', params, 'application/json')
}

export const exportItem = params => {
    return dpwnloadRequest('item/list/export', params, 'application/json')
}

export const exportProduct = params => {
    return dpwnloadRequest('product/manage/productList/export', params, 'application/json')
}

export const createProductTag = params => {
    return postRequest('/product/manage/createProductTag', params, 'application/json')
}

export const getStkLocationMsg = params => {
    return postRequest('/stkManage/getStkLocationMsg', params, 'application/json')
}

export const addStkLocation = params => {
    return postRequest('/stkManage/addStkLocation', params, 'application/json')
}

export const updateStkLocaiton = params => {
    return postRequest('/stkManage/updateStkLocaiton', params, 'application/json')
}

export const updatePublishStatus = params => {
    return postRequest('/product/manage/updatePublishStatus', params, 'application/json')
}

export const getStkProductList = params => {
    return postRequest('/stk_product/getStkProductList', params, 'application/json')
}

export const getStkProductDetail = params => {
    return postRequest('/stk_product/getStkProductDetail', params, 'application/json')
}

export const intostk = params => {
    return postRequest('/stk_product/in_out_stk', params, 'application/json')
}

export const stockChangeRecord = params => {
    return postRequest('/stk_product/stockChangeRecord', params, 'application/json')
}

export const wholeStkRecord = params => {
    return postRequest('/stk_product/wholeStkRecord', params, 'application/json')
}

export const getBomUnderMaterial = params => {
    return postRequest('/bom/details', params, 'application/json')
}

export const updateBomUsages = params => {
    return postRequest('/bom_improve/updateBomUsagesImprove', params, 'application/json')
}

export const addBomMsg = params => {
    return postRequest('/bom_improve/addBomMsgImprove', params, 'application/json')
}

export const deleteBomUsages = params => {
    return postRequest('/bom_improve/deleteBomMsgImprove', params, 'application/json')
}

export const bomExcel = params => {
    return dpwnloadRequest('/bom_improve/importExcelImprove', params, 'application/json')
}

export const updateReviewStatus = params => {
    return postRequest('/bom/updateReviewStatus', params, 'application/json')
}

export const importClotheAndPants = params => {
    return postRequest('/bom_improve/importBomMsgImprove', params, 'application/json')
}

export const cancelBind = params => {
    return postRequest('/bom/cancelBind', params, 'application/json')
}

export const updatePmMdlItem = params => {
    return postRequest('/pm_Mdl/updatePmMdlItem', params, 'application/json')
}

export const getPmMdlDetail = params => {
    return postRequest('/pm_Mdl/getPmMdlDetail', params, 'application/json')
}

export const updateStatus = params => {
    return postRequest('/pm_Mdl/updateStatus', params, 'application/json')
}

export const getEMBElement = params => {
    return postRequest('/pm_Mdl/getEMBElement', params, 'application/json')
}

export const getFABByEMB = params => {
    return postRequest('/pm_Mdl/getFABByEMB', params, 'application/json')
}

export const getBomTreeMsg = params => {
    return postRequest('/bom_improve/getBomTreeMsg', params, 'application/json')
}

export const getDetailMsg = params => {
    return postRequest('/bom_improve/getDetailMsg', params, 'application/json')
}

export const importSimilarMatBom = params => {
    return postRequest('/bom_improve/importSimilarMatBom', params, 'application/json')
}

export const checkIsUsed = params => {
    return postRequest('/bom_improve/checkIsUsed', params, 'application/json')
}

export const getActivityList = params => {
    return postRequest('/activity/getList', params, 'application/json')
}

export const getNotPartakeProductItem = params => {
    return postRequest('/activity/getNotPartakeProductItem', params, 'application/json')
}

export const addActivity = params => {
    return postRequest('/activity/addActivity', params, 'application/json')
}

export const updateActivityDetail = params => {
    return postRequest('/activity/updateActivityDetail', params, 'application/json')
}

export const deleteActivDetail = params => {
    return postRequest('/activity/deleteActivDetail', params, 'application/json')
}

export const getPictureMsg = params => {
    return postRequest('/picture/getPictureMsg', params, 'application/json')
}

export const updatePictrueMsg = params => {
    return postRequest('/picture/updatePictrueMsg', params, 'application/json')
}

export const getSceneList = params => {
    return postRequest('/scene/getSceneList', params, 'application/json')
}

export const addScene = params => {
    return postRequest('/scene/addScene', params, 'application/json')
}

export const updateScene = params => {
    return postRequest('/scene/updateScene', params, 'application/json')
}

export const deleteScene = params => {
    return postRequest('/scene/deleteScene', params, 'application/json')
}

export const getOrderList = params => {
    return postRequest('/order/getOrderList', params, 'application/json')
}

export const exportOrderList = params => {
    return dpwnloadRequest('order/exportOrderList', params, 'application/json')
}

export const getOrderDetail = params => {
    return postRequest('/order/getOrderDetail', params, 'application/json')
}

export const updateOrderStatus = params => {
    return postRequest('/order/updateOrderStatus', params, 'application/json')
}
